package com
{
	import com.assist.view.LoadResponder;
	import com.views.Structure;
	
	import flash.display.Stage;
	import flash.events.Event;

	public class ViewBase extends SuperBase
	{
		protected var _data :Data;
		protected var _ctrl :Controller;
		protected var _lang :Lang;
		protected var _stage :Stage;
		protected var _structure :Structure;
		
		public function ViewBase( s :Stage )
		{
			_stage = s;
		}
		
		public function init( data :Data, controller :Controller, lang :Lang ) :void {
			_data = data;
			_ctrl = controller;
			_lang = lang;
			_structure = Structure.getInstance( _stage, this );
			
			_stage.addEventListener(Event.RESIZE, resetPosition);
		}
		
		public function loadResources(list :Array, loadResponder :LoadResponder, fullUrl:Boolean = false) : void {
			
		}
		
		protected function createObject(classDefinition:Class) : Object
		{
			var className :String = (classDefinition + "").replace(/View\]$/, "");
			return createObjectBase(classDefinition, className, this as View, _ctrl, _data);
		}
		
		public function get structure() : Structure
		{
			return _structure;
		}
		
		public function get stage() : Stage
		{
			return _stage;
		}
		
		private function resetPosition( event :Event ) :void {
			
		}
	}
}